package org.jeecg.modules.charge.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.entity.charge.ChargeBills;
import org.jeecg.modules.charge.entity.ChargeBillsOrder;
import org.jeecg.modules.charge.vo.ChargeAppProperty;
import org.jeecg.modules.charge.vo.ChargePayRecordsByRoom;

import java.util.List;

/**
 * @Description: App
 * @Author: Lee
 * @Date:   2019-08-22
 * @Version: V1.0
 */
public interface ChargeAppMapper{
    //根据对应的房间ID和是否业主或租户获取对应的账单
    List<ChargeBills> getBillsByRoomId(@Param("roomId") String roomId, @Param("feeType") String feeType, @Param("cusOrRent") String cusOrRent);
    //拉取房间对应的最后一次缴费记录
    @SqlParser(filter = true)
    ChargePayRecordsByRoom getPayRecordsByRoom(@Param("roomId") String roomId);
    //获取用户对应的所有的缴费记录
    @SqlParser(filter = true)
    List<ChargeBillsOrder> getPayRecordsByUid(@Param("userId") String userId);
    //查询物业公司名称
    String getNameByTenantId(@Param("tenantId") String tenantId);
    //查询对应的账单缴费应收年月段
    @SqlParser(filter = true)
    String getCnysByBids(@Param("billids") List<String> billids);
    List<ChargeAppProperty> getFloorsByPid (@Param("projectId") String projectId);
    List<ChargeAppProperty> getRoomsByFid (@Param("floorId") String floorId);
    //获取项目下的基础信息
    List<ChargeAppProperty>  getBaseInfos();
    //查询维修部位
    @SqlParser(filter = true)
    String getRepair(@Param("repairNo") String repairNo);
    //获取用户对应的停车费缴费记录
    @SqlParser(filter = true)
    List<ChargeBillsOrder> getPayCarByUid(@Param("userId") String userId);

    @SqlParser(filter = true)
    @Select("SELECT tenant_id FROM base_room where id = #{roomId} AND del_flag = '0'")
    String getTenentByRoomId(@Param("roomId")String roomId);
}
